package com.yanmaohu.yulia.bean;

import java.util.List;

/**
 * @author Bright Lee
 */
public final class StatementInformation implements SqlDiagnosticsInformation {

    private int beginIndex;
    private int endIndex;
    private List<StatementInformationItem> statementInformationItemList;

    public StatementInformation(List<StatementInformationItem> statementInformationItemList) {
        this.beginIndex = statementInformationItemList.get(0).getBeginIndex();
        this.endIndex = statementInformationItemList.get(statementInformationItemList.size() - 1).getEndIndex();
        this.statementInformationItemList = statementInformationItemList;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public int size() {
        return statementInformationItemList.size();
    }

    public StatementInformationItem get(int index) {
        return statementInformationItemList.get(index);
    }

}
